import { Button, Col, Form, Input, Row } from 'antd';
import { SearchOutlined, ReloadOutlined, ArrowRightOutlined } from '@ant-design/icons';
import { CalibrateHomeAPI } from '../common/type';
import { onMouseOutBtn } from '@/utils';
import { history } from 'umi';

export const CalibrateTableExtraview: React.FC<CalibrateHomeAPI.ICalibrateTableExtraView> = ({
  searchForm,
  styleFixCls,
  getTaskCheckData,
  tabPaneKey,
  pageSizeObj,
}) => {
  return (
    <div className={`${styleFixCls}-extraSearch`}>
      <Form form={searchForm}>
        <Row gutter={[8, 8]}>
          <Col span={7}>
            <Form.Item name="taskName">
              <Input placeholder="当前环节" allowClear />
            </Form.Item>
          </Col>
          <Col span={7}>
            <Form.Item name="purchProjectName">
              <Input placeholder="定标标题" allowClear />
            </Form.Item>
          </Col>
          <Col span={10} style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}>
            <Button
              type="primary"
              // size="small"
              icon={<SearchOutlined />}
              onClick={() => {
                const params: Record<string, any> = {
                  ...searchForm?.getFieldsValue(),
                  ...pageSizeObj,
                  taskType: tabPaneKey == '1' ? false : true,
                };
                getTaskCheckData(params);
              }}
            >
              查询
            </Button>
            &nbsp;
            <Button
              // size="small"
              icon={<ReloadOutlined />}
              onMouseOut={onMouseOutBtn}
              onClick={() => {
                searchForm?.resetFields();
                getTaskCheckData({
                  current: 1,
                  pageSize: 10,
                  taskType: tabPaneKey == '1' ? false : true,
                });
              }}
            >
              重置
            </Button>
            &nbsp;
            {/* <Button
              // size="small"
              icon={<ArrowRightOutlined />}
              onMouseOut={onMouseOutBtn}
              onClick={() => {
                history?.push({
                  pathname: '/contractController/taskManage',
                  state: {
                    tabsPaneKey: tabPaneKey,
                  },
                });
              }}
            >
              更多
            </Button> */}
          </Col>
        </Row>
      </Form>
    </div>
  );
};
